home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / Arkanoid Flash.swf / scripts / frame_28 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.2 KB  |  45 lines

  1. i = "1";
  2. while(noOfSH >= i)
  3. {
  4.    shrink_y = getProperty("shrink" add i, _Y);
  5.    shrink_y += "6";
  6.    setProperty("shrink" add i, _Y, shrink_y);
  7.    if("390" < shrink_y)
  8.    {
  9.       bat_x = getProperty("/bat", _X);
  10.       bat_left = bat_x - batWidth / "2";
  11.       bat_right = bat_x + batWidth / "2";
  12.       shrink_x = getProperty("shrink" add i, _X);
  13.       shrink_left = shrink_x - "10";
  14.       shrink_right = shrink_x + "10";
  15.       if(shrink_left >= bat_left and bat_right >= shrink_right)
  16.       {
  17.          tellTarget("/soundFX")
  18.          {
  19.             gotoAndStop("shrink");
  20.             play();
  21.          }
  22.          trace("You\'ve just got SHRINK");
  23.          if(shrunken == "0")
  24.          {
  25.             shrunken = "1";
  26.             setProperty("/bat", _xscale, "50");
  27.             batWidth = "40";
  28.             stopDrag();
  29.             startDrag("/bat","1","30","400","390","400");
  30.             power_up = "shrink";
  31.             expanded = "0";
  32.             call("reset_capsules");
  33.          }
  34.          removeMovieClip("shrink" add i);
  35.          onscreen_SH = "0";
  36.       }
  37.       else
  38.       {
  39.          removeMovieClip("shrink" add i);
  40.          onscreen_SH = "0";
  41.       }
  42.    }
  43.    i += "1";
  44. }
  45.